<?
/**
 * class <b>Hli_TrackingArray Class</b>
 * Published 12/09/2011 15:58:19
 *
 * @author Lars Sorhus (lars@saucecode.com.au)
 * @copyright sauceCode Pty Ltd.
 * @version 2.0.5.105.
 * @internal It's not recommended at all to modify this code.
 */
class Hli_TrackingArray extends Hli_Serializer{
	public $data=array();

   /**
    * Constructor
    */
	public function  __construct($TrackingArrayRaw){
		parent::__construct();
		$this->setTrackingArray($TrackingArrayRaw);
	}

	/**
    * Gets the tracking information via an array structure.
    *
	 * @method getTrackingArray
	 * @return TrackingStatus[]
	 */
	public function getTrackingArray(){
		return($this->data);
	}
	public function getItems(){
		return($this->getTrackingArray());
	}

	/**
    * Sets the tracking information.
    *
	 * @method setTrackingArray
	 * @param array $TrackingArrayRaw
	 * @return void
	 */
	public function setTrackingArray($TrackingArrayRaw){
		$this->data=array();
		if(is_array($TrackingArrayRaw)&&count($TrackingArrayRaw)>0){
			foreach($TrackingArrayRaw as $Item){
				$this->data[]=new Hli_TrackingStatus($Item);
			}
		}
	}

	/**
    * Gets the item at position $Index in the tracking array
    * (first item is at 0 position).
    *
	 * @method getItemAt
	 * @param uint $Index
	 * @return TrackingStatus
	 */
	public function getItemAt($Index){
		$result=false;
		$TrackingStati=$this->data;
		if(is_array($TrackingStati)&&count($TrackingStati)-1>=$Index){
			$result=$TrackingStati[$Index];
		}
		return($result);
	}
}
?>
